function MenuTab(menuConfig){
	this.config = menuConfig;
}
MenuTab.prototype.addTab=function(label,boxM,iconeM,tmItens,tabid){	
	var menuToPut = $('<li class="navitem" id="tabmenu_'+tabid+'">'
							+'<a class="" href="#"><span class="imgI glyphicon iconeinput glyphicon-'+iconeM+'"></span><label>'+label+'</label></a>'
					  +'</li>');
	$(this.config.target).parents("div.menu_main").find(".tab_content_menu").append(boxM);
	$(this.config.target).append(menuToPut);
};
MenuTab.prototype.criarTabNova=function(label,picone,childrens,tabid){
	var boxM = $('<ul class="nav nav-pills" style="display: none;" id="tabmenu_'+tabid+'_l">');
	var tml = childrens.length;
	var iconeM = "file";
	for(var z = 0;z<tml;z++){
			var btTab = new LinkButton(childrens[z].label);
			if(childrens[z].icone!=" "){
				btTab.setIcon(childrens[z].icone);
				iconeM = childrens[z].icone;
			}
			//if(window[childrens[z].funcao]){
			if(childrens[z].tela!=""){
				btTab.htmlX[0]["evt"]={"tela":childrens[z].tela,"caminho":childrens[z].caminho,"fn":childrens[z].funcao};
			}else{
				btTab.setEnable(false);
			}
			boxM.append(btTab.htmlX);
	}	
	this.addTab(label,boxM,picone,tml,tabid);
};

MenuTab.prototype.setDataProvider=function(dta){			
	var tml = dta.length;
	for(var z = 0;z<tml;z++){
		this.criarTabNova(dta[z].label,dta[z].icone,dta[z].children,z);
	}
	//this.setFirstActive();
	//this.htmlX.find(".menus").append('<li class="pull-right"><span class="badge pull-right">0</span></li>');
	
	this.appendTo(this.config["target"]);
	//$(this.config["target"]).find("li:first").click();
	//$(this.htmlX[0]["config"]["target"]).find(".menus").append('<li class="pull-right"><a href="#" class="pull-right"><span class="badge pull-right">0</span><a></li>');
};

MenuTab.prototype.setIcon=function(src){
	//$(this.htmlX[0]["config"]["target"]).parents("nav").find(".navbar-brand:first").prepend('<img class="img" alt="140x140" src="'+src+'" />');
	//this.barraAbaTitle.find(".tabMenu").css("background-image","url('"+src+"')");
};

MenuTab.prototype.appendTo=function(idFather){
	$(idFather).prepend(this.htmlX);
	//$(idFather).find('li:eq(0) a').click();
};


	
